<?php
class tpl_Form_Radio {
	function call($toObj) {
		foreach ((array)Y('Module.List.Editor.getOptions', Y('Module.List.Editor.Form.Option')) as $Key=>$Val) {

			$Form = $toObj->DOG_appendChild('input')->attr(array(
				'type'=>'radio',
				'id'=>Y('Module.List.Editor.Form.Name').htmlspecialchars($Key),
				'class'=>'Form radio '.Y('Module.List.Editor.Form.Name'),
				'name'=>Y('Module.List.Editor.Form.Name'),
				'tabindex'=>Y('Module.List.Editor.Form.TabIndex'),
				'value'=>htmlspecialchars($Key),
			));
			if (Y('Module.List.Editor.Form.Value') == $Key) {
				$Form->attr(array('checked'=>'checked'));
			}
			
			$toObj->DOG_appendChild('label')->attr(array(
				'for'=>Y('Module.List.Editor.Form.name').htmlspecialchars($Key)
			))->text(htmlspecialchars($Val));
		}
	}
}
?>